<div class="crumb-wrap">
    <div class="crumb-list"><i class="icon-font"></i><a href="<?=site_url('admini') ?>">首页</a><span class="crumb-step">&gt;</span><a href="<?=site_url('admini/power') ?>">权限管理</a><span class="crumb-step">&gt;</span><span>权限添加</span></div>
</div>
<div class="result-wrap">
    <div class="result-content">
        <form action="<?=site_url('admini/power/create')?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
            <table class="insert-tab" width="100%">
                <tbody>
                    <tr>
                        <th width="120"><i class="require-red">*</i>上级权限：</th>
                        <td id="sort">
                            <select name="pid" id="catid" class="required top_0" onchange="getsort(0,this.value)">
                                <option value="0">--顶级权限--</option>
                                <?php foreach ($list as $k => $v):?>
                                <option value="<?=$v['id']?>"><?=$v['name']?></option>
                                <?php endforeach;?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th width="120"><i class="require-red">*</i>权限分类：</th>
                        <td id="sort">
                            <select name="basis" id="catid" class="required top_0" onchange="getsort(0,this.value)">
                                <option value="0">--常用操作--</option>
                                <option value="1">--系统管理--</option>
                                <option value="3">--其他--</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>权限名称：</th>
                        <td>
                            <input class="common-text required" id="name" name="name" size="50" value="" type="text">
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>路由地址：</th>
                        <td>
                            <input class="common-text required" id="url" name="url" size="50" value="" type="text">
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                            <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                            <span>前面有“*”符号的内容不能为空</span>
                        </td>
                    </tr>
                </tbody></table>
        </form>
    </div>
</div>
<script>
    $('#myform').submit(function() {
        $(this).ajaxSubmit(function(data){
            if(data == 1){
                layer.alert('修改成功！',{
                    icon:1,
                },function(){
                    location.reload(true);
                });
            }else{
                layer.alert(data,{
                    icon:2,
                });
            }
        })
        return false;
    })
</script>